package com.travelgroup.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.travelgroup.domain.entity.PaymentOrder;
import com.travelgroup.domain.entity.TourGroup;
import com.travelgroup.domain.entity.User;
import com.travelgroup.enums.PayType;
import com.travelgroup.exception.R;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

public interface IPaymentOrderService extends IService<PaymentOrder> {
    R<PaymentOrder> createPaymentOrder(TourGroup group, User user, BigDecimal amount, PayType payType);
    R<PaymentOrder> getOrderByOrderNo(String orderNo);

    Map<String, Object> getPaymentInfo(PaymentOrder paymentOrder, String groupTitle);

    boolean handlePaymentCallback(String trade_no, String orderNo, BigDecimal amount);
    boolean hasUserPaid(Long groupId, Long userId);


    R<?> cancelPayment(String orderNo);

    boolean refundByGroupAndUser(Long groupId, Long userId, String reason);

    void processBatchRefund(List<PaymentOrder> paymentOrders);
}
